package ProducerConsumer_Mantou;

/**
 * Created by key on 2015/3/1.
 */
public class Producer implements Runnable{
    StackBasket ss = new StackBasket();
    Producer(StackBasket ss){
        this.ss = ss;
    }
    public void run(){
        for(int i = 0;i<20;i++){
            Mantou m = new Mantou(i);
            ss.push(m);

            try{
                Thread.sleep((int)(Math.random()*500));
            }catch(InterruptedException e){
                e.printStackTrace();
            }
        }
    };
}
